import 'package:flutter/material.dart';

class MyImage extends StatelessWidget {
  final String url;

  const MyImage({super.key, required this.url});

  const MyImage.url(this.url, {super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 50,
      height: 50,
      clipBehavior: Clip.hardEdge,
      decoration: const BoxDecoration(
        color: Colors.black,
      ),
      child: Image.network(
        url,
        fit: BoxFit.cover,
      ),
    );
  }
}

class MyCircleImage extends StatelessWidget {
  final String url;

  const MyCircleImage({super.key, required this.url});

  const MyCircleImage.url(this.url, {super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 50,
      height: 50,
      clipBehavior: Clip.hardEdge,
      decoration: const BoxDecoration(
        color: Colors.black,
        borderRadius: BorderRadius.all(Radius.circular(50)),
        // image: DecorationImage(image: NetworkImage(url))
      ),
      child: Image.network(
        url,
        fit: BoxFit.cover,
      ),
    );
  }
}

class ClipOvalImage extends StatelessWidget {
  final String url;

  const ClipOvalImage({super.key, required this.url});

  const ClipOvalImage.url(this.url, {super.key});

  @override
  Widget build(BuildContext context) {
    return ClipOval(
      child: Image.network(
        width: 150,
        height: 150,
        url,
        fit: BoxFit.cover,
      ),
    );
  }
}

class LocalImage extends StatelessWidget {
  final String url;

  const LocalImage({super.key, required this.url});

  const LocalImage.url(this.url, {super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 200,
      height: 200,
      clipBehavior: Clip.hardEdge,
      decoration: const BoxDecoration(
        color: Colors.transparent,
        borderRadius: BorderRadius.all(Radius.circular(50)),
      ),
      child: Image.asset(
        url,
        fit: BoxFit.fitHeight,
      ),
    );
  }
}
